package com.bolt.report.engine.fill;

import com.bolt.report.engine.FillElementVisitor;
import com.bolt.report.engine.export.Exporter;
import com.fasterxml.jackson.databind.JsonNode;

public class FillChartElement  extends BaseFillElement<String> {

    private JsonNode jsonData;

    private String chartId;

    private int width;

    private int height;

    private FillContext fillContext;

    public FillChartElement(JsonNode jsonData, FillContext fillContext) {
        this.jsonData = jsonData;
        this.fillContext = fillContext;
    }

    public JsonNode getJsonData() {
        return jsonData;
    }

    public FillContext getFillContext() {
        return fillContext;
    }

    public String getChartId() {
        return chartId;
    }

    public void setChartId(String chartId) {
        this.chartId = chartId;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    @Override
    public String getValue() {
       return jsonData.toString();
    }


    @Override
    public <T> void accept(FillElementVisitor<T> visitor, T arg) {
        visitor.visit(this, arg);
    }

    @Override
    public <E extends Exporter> void accept(ExporterVisitor<E> visitor, E exporter)  {
        visitor.visit(this,exporter);
    }
}